package cn.zyzpp.dao;

import cn.zyzpp.entity.job.NewJob;
import cn.zyzpp.entity.user.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;


/**
 * Create by yster@foxmail.com 2018/5/17/017 18:18
 */
@Repository
public interface UserDao extends JpaRepository<User,Integer> {
    /**
     * 通过邮箱查找密码
     * @param
     * @return
     */
    User findPasswordByMail(String username);

    /**
     * 通过邮箱账号查找唯一ID
     * @param username
     * @return
     */
    User findIdByMail(String username);

    /**
     * 通过用户名查找角色
     * @param username
     * @return
     */
    User findUserRoleByMail(String username);

    User findAllById(int id);

    User findImgUrlById(int id);

    Page<User> findAll(Pageable pageable);
}
